package com.jason.amber.designpattern.singleton;

/**
 * 双重校验锁,线程安全
 * Created by fuyongde on 16/4/2.
 */
public class Singleton7 {
    private volatile static Singleton7 instance;

    private Singleton7() {
    }

    public static Singleton7 getInstance() {
        if (instance == null) {
            synchronized (Singleton7.class) {
                instance = new Singleton7();
            }
        }
        return instance;
    }

}
